/**
 * @BelongsProject : LeetCode
 * @Author : WXY
 * @CreateTime : 2022-12-07  11:16
 * @Description : 剑指 Offer 10- II. 青蛙跳台阶问题
 * @Version : 1.0
 */

public class Num10_2_numWays {
    public static int val = (int) (1e9+7);
    public static int numWays(int n) {
        if (n == 1 || n == 0)return 1;
        int[] dp = new int[n + 1];
        dp[0] = 1;
        dp[1] = 1;
        for (int i = 2; i <= n; i++) {
            dp[i] = (dp[i - 1] + dp[i - 2]) % val;
        }
        return dp[n];
    }

    public static void main(String[] args) {
        System.out.println(numWays(7));
        System.out.println(numWays(2));
        System.out.println(numWays(10));
        System.out.println(numWays(7));
    }
}
